<?php
$majors=include(APP_DIR.'/Configs/majors.php');
?>
<html>
<head>
<title>main</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="<?php echo CSS_DIR ?>/pagerNav.css" />
<link rel="stylesheet" type="text/css" href="<?php echo CSS_DIR ?>/admin.css" />
</head>
<body>
<br>
<form action="<?php echo url('AdminWork','searchWorkers') ?>" method="POST">
	<table width="98%" align="center" cellpadding="1" cellpadding="3" cellpadding=i_talbe>
		<tr>
			<td class=head colspan="7">员 工 搜 索</td>
		</tr>
		<tr>
			<td align="center" width="10%">姓名: </td>
			<td align="center" width="10%"><?php echo $form['worker']['trueName'] ?> </td>
			<td align="center" width="10%">籍贯: </td>
			<td align="center" width="10%"><?php echo $form['worker']['province'] ?> </td>
			<td align="center" width="10%">层次: </td>			
			<td align="center" width="10%"><?php echo $form['worker']['userType'] ?> </td>			
			<td align="center" width="10%"></td>

		</tr>
		<tr>
			<td align="center">学院：</td>
			<td align="center"><?php echo $form['worker']['college2'] ?><br><?php echo $form['worker']['college'] ?> </td>
			<td align="center">系&nbsp;：</td>
			<td align="center"><?php echo $form['worker']['department2'] ?><br><?php echo $form['worker']['department'] ?></td>
			<td align="center">专业：</td>
			<td align="center"><?php echo $form['worker']['major2'] ?><br><?php echo $form['worker']['major'] ?></td>		
			<td align="center" width="10%"></td>

		</tr>
		<tr>
			<td align="center">贫困生：</td>
			<td align="center"><?php echo $form['worker']['poor'] ?> </td>
			<td align="center">部门：</td>
			<td align="center"><?php echo $form['worker']['group'] ?></td>
			<td align="center">办公室：</td>
			<td align="center"><?php echo $form['worker']['office'] ?></td>
			<td align="center" width="10%"></td>

		</tr>
			<tr>
			<td align="center">整合搜索??：</td>
			<td align="center"><?php echo $form['worker']['zhenghe'] ?> </td>
			<td align="center">报名开始日期：</td>
			<td align="center"><?php echo $form['worker']['startDate'] ?></td>
			<td align="center">报名截止日期：</td>
			<td align="center"><?php echo $form['worker']['endDate'] ?></td>
			<td align="center">
				<input type="submit" value="查询" />
			</td>
		</tr>
	</table>
</form>
<table width=98% align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head>员 工 管 理<div align="right"><font color="Black"><?php echo $resultCount; ?></font><div></tr>
<tr><td class=b>
	<table class="listTb">
	  <tr class="title">
		<td width="10%">员工编号</td>
		<td width="10%">姓名</td>
		<td width="7%">性别</td>
		<td width="15%">学院</td>
		<td width="15%">专业</td>
		<td width="8%">贫困生</td>
		<td width="10%">培养层次</td>
		<td width="10%">填表日期</td>
		<td width="15%">操作</td>
	  </tr>
	  <tr><td colspan="9">&nbsp;</td>
	  <?php foreach ($lists as $list){ ?>
	  <tr class="list">
		<td><?php echo $list['number'] ?></td>
		<td><?php echo $list['user']['trueName'] ?></a></td>
		<td><?php echo $list['user']['sex'] ?></td>
		<td><?php echo $list['user']['college'] ?></td>
		<td><?php echo $list['user']['major'] ?></td>
		<td><?php echo $list['user']['poor'] ?></td>
		<td><?php echo $list['user']['userType'] ?></td>
		<td><?php echo $list['created'] ?></td>
		<td>
		<a  href="<?php echo url('AdminWork', 'viewWorker', array('user_id'=>$list['user_id'])); ?>">［查看］</a>
		</td>
	  </tr>
	  <tr><td colspan="9"><hr width="99%" /></td>
	  <?php } ?>
	</table>
	<div>
		<?php echo $pagerData1 ?>	
		<a style="
        font-size: 12px;
        font-weight: bold;
        list-style: none;
        margin: 0px;
        padding: 0px;       
		border: 1px solid #2E6AB1;
        padding: 2px 6px 2px 6px;
        background-color: #2E6AB1;
        color: #fff;"
		 target="_blank"
		href="<?php echo url('AdminWork','workerconnect'); ?>">生成通讯录</a>
	</div>
</td>
</tr></table>
<br>
<script language="javascript">
var objs = document.getElementsByTagName("div");var old;
for (var i = 0;i < objs.length;i++) {

	var obj = objs[i];
	if (obj.className == "list") {
		obj.onmouseover = function() {
			old = this.style.background;
			this.style.background = "#E2E2FE";
		}
		obj.onmouseout = function() {
			this.style.background = old;
		}
	}
}
</script>
<script type="text/javascript">
var maj=new Array();
<?php
//构造js形式的数组
$i=0;
foreach ($majors as $k => $v){
	foreach ($v as $kk => $vv){
		foreach ($vv as $kkk => $vvv){
			echo "maj[$i]=new Array();";
			echo "maj[$i][0]='$k';";
			echo "maj[$i][1]='$kk';";
			echo "maj[$i][2]='$vvv';";
			$i++;
		}
	}
}
?>
//初始化“学院”选项
	var college = document.getElementById('college');
	var count=maj.length;
	var k=1;
	for(var j=0;j<count;j++){
		if((k==1 || maj[j-1][0]!= maj[j][0]) && maj[j][0]!=<?php echo '"'.$data['college'].'"' ?>){
			college.options[k]=new Option(maj[j][0],maj[j][0]);
			k++;
		}	
	}
//初始化“系”选项
	var department = document.getElementById('department');
	var count=maj.length;
	var k=1;
	for(var j=0;j<count;j++){
		if((k==1 || maj[j-1][1]!= maj[j][1]) && maj[j][0]==<?php echo '"'.$data['college'].'"' ?> && maj[j][1]!=<?php echo '"'.$data['department'].'"' ?>){
			department.options[k]=new Option(maj[j][1],maj[j][1]);
			k++;
		}	
	}
//初始化“专业”选项
	var major = document.getElementById('major');
	var k=1;
	for(var j=0;j<count;j++){
		if((k==1 || maj[j-1][2]!= maj[j][2]) && maj[j][0]==<?php echo '"'.$data['college'].'"' ?> && maj[j][2]!=<?php echo '"'.$data['major'].'"' ?>){
			major.options[k]=new Option(maj[j][2],maj[j][2]);
			k++;
		}	
	}
//根据“学院”的值构造“系”的范围
function selectDepartment(){
	var college = document.getElementById('college');
	var department = document.getElementById('department');
	var major = document.getElementById('major');
	department.length=1;
	major.length=1;
	var k=1;
	for(var j=0;j<maj.length;j++){
		if(null==college.value)
			college.value=<?php echo '"'.$data['college'].'";';  ?>		
		if(maj[j][0] == college.value  && (k==1 || maj[j-1][1]!= maj[j][1] )){
			department.options[k]=new Option(maj[j][1],maj[j][1]);
			k++;
		}	
	}
}
//根据“学院”和“系”的值构造“专业”的范围
function selectMajor(){
	var college = document.getElementById('college');
	var department = document.getElementById('department');
	var major = document.getElementById('major');
	major.length=1;
	var k=1;
	for(var j=0;j<maj.length;j++){
			if(maj[j][0]==college.value && maj[j][1]==department.value  ){
				major.options[k]=new Option(maj[j][2],maj[j][2]);
				k++;
		}	
	}
}

</script>
</body></html>